package org.jeecg.modules.monitoring.j_monitoring.utils;

import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.toolkit.JdbcUtils;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.DataBaseConstant;
import org.jeecg.common.constant.ServiceNameConstants;
import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.common.util.oss.OssBootUtil;
import org.jeecg.modules.monitoring.j_monitoring.constantConfig.MonitorStatusEnum;
import org.jeecgframework.poi.util.PoiPublicUtil;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.stereotype.Component;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;

import jakarta.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Description: 通用工具
 * @Author: wangd
 */
@Slf4j
public class EquipmentUtils {



    public static String getMonitorStatus(String code){
        if (StringUtils.isEmpty(code)){
            return MonitorStatusEnum.notMonitored.getKey();
        }

        return "1".equals(code)?MonitorStatusEnum.online.getKey():MonitorStatusEnum.notMonitored.getKey();

    }

    public static String getRingStatus(String code){
        if (StringUtils.isEmpty(code)){
            return "4";
        }
        if (code.equals("1")){
            return "3";
        }


        return "4";

      }

}
